package com.zyd.databindingdemo.mvvm.view;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import android.os.Bundle;

import com.zyd.databindingdemo.R;
import com.zyd.databindingdemo.databinding.ActivityLogin2MainBinding;
import com.zyd.databindingdemo.mvvm.model.User;
import com.zyd.databindingdemo.mvvm.viewmodel.ViewModel;

public class Login2MainActivity extends AppCompatActivity {

    ActivityLogin2MainBinding activityLogin2MainBinding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        activityLogin2MainBinding = DataBindingUtil.setContentView(this,R.layout.activity_login2_main);

        User user = new User( "admin","12345" );
        activityLogin2MainBinding.setViewModel( new ViewModel( activityLogin2MainBinding,user ) );
    }
}